package com.wk.database;

import com.wk.database.entity.definition.Column;
import com.wk.database.entity.definition.ColumnType;
import com.wk.database.entity.definition.Condition;
import com.wk.database.entity.definition.Table;

@Table("t_business_computing_resource_management")
public class MasterMachine {
	public MasterMachine() {
	}

	public MasterMachine(String ip, String state) {
		this.ip = ip;
		this.state = state;
	}

	public boolean isOnline() {
		return state.equals(MachineState.NORMAL);
	}

	@Override
	public String toString() {
		return "[" + type + "]" + ip + "：" + state;
	}

	@Column(name = "resource_type", type = ColumnType.STRING)
	@Condition("= '主节点'")
	public String type;

	@Column(name = "resource_ip_address", type = ColumnType.STRING)
	public String ip;

	@Column(name = "machine_status", type = ColumnType.STRING)
	@Condition("= '"+MachineState.NORMAL+"'")
	public String state;
}
